package com.city.repository.report;

import com.city.domain.report.CtMessage;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface MessageRepository extends JpaRepository<CtMessage,Integer> {

    @Query(value =  "SELECT * FROM ct_message " +
                    "WHERE accept_id = ?1 " +
                    "AND type = ?2",nativeQuery = true)
    List<CtMessage> findByAcceptIdAndType(Integer acceptId, String type);


    @Query(value =  "SELECT * FROM ct_message " +
                    "WHERE accept_id = ?1 ",nativeQuery = true)
    List<CtMessage> findByAcceptId(Integer acceptId);


}
